#include <stdio.h>
 
int main() {
    
    int a , b, c;
    scanf("%d", &a); 
    int number[10]={0};
    int count = 0; 
    while(a!= 0){
        b = a / 16; 
        c = a % 16; 
        if(c >= 10)
            c = c - 10 + 'A'; 
        else
            c = c + '0'; 
        number[count++]=c; 
        a=b; 
    }
  
    for(int i=count-1;i>=0;i--) 
        printf("%c",number[i]); 
  
  
    return 0; 
}